package bd403.UIComponents;

/* UI and functionality for the viewing a help topic of the BrewDawg application.
 * Main authors: Cody & Brendan
 */

import bd403.Backend.Help;
import bd403.namespace.BDActivity;
import bd403.namespace.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

/* Front-end functionality for the Help page.
 * Main authors: Cody and Brenden
 */

public class HelpViewActiv extends Activity {
	private Help help;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.helpanswer);

        // Get the current Drink that's being viewed
        help = BDActivity.getHelp();
        String answer = help.getAnswer();
        String question = help.getTopic();
        
        setAnswerText(answer, question);
    }
    
    /*
     * Sets the info for the current drink the user is viewing
     */
    private void setAnswerText(String a, String b) {
        TextView answer = (TextView) findViewById(R.id.answer);
        TextView question = (TextView) findViewById(R.id.question);
        
        TextView title = (TextView) findViewById(R.id.title);

        answer.setText(a);
        //question.setText(b);
        title.setText(b);
    }
}
